﻿using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;

namespace PairingMatrix.View
{
    /// <summary>
    /// Interaction logic for ToolBarControl.xaml
    /// </summary>
    public partial class ToolBarControl : UserControl
    {
        public ToolBarControl()
        {
            InitializeComponent();
            newCardButton.ImagesSource = "/PairingMatrix;component/View/Image/ProjectCardButton.png";
            newTeamMemberButton.ImagesSource = "/PairingMatrix;component/View/Image/TeamMemberCardButton.png";
            pairingMatrixButton.ImagesSource = "/PairingMatrix;component/View/Image/PairingMatrix.png"; 
            iceCreamButton.ImagesSource = "/PairingMatrix;component/View/Image/IceCream.jpg";
            settingsButton.ImagesSource = "/PairingMatrix;component/View/Image/Settings.jpg";
            syncButton.ImagesSource = "/PairingMatrix;component/View/Image/SyncWithMingle.png";
            saveButton.ImagesSource = "/PairingMatrix;component/View/Image/Save.png";
        }

        private void addCard_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            addCardNumber.Visibility = System.Windows.Visibility.Visible;
        }

        private void addCard_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            addCardNumber.Visibility = System.Windows.Visibility.Collapsed;
        }

        private void addCardNumber_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if(e.Key == Key.Enter)
                newCardButton.Command.Execute(addCardNumber.Text);
        }

    }
}
